1. Technical Field
The present invention relates to a data player and a data play method in which a synchronous pattern contained in audio data or the like can be detected.
2. Related Art
As shown in FIG. 4, a conventional data player 100 includes an interface section 10, a synchronous pattern detection section 12, a register 14, a counter 16, a synchronization determination section 18, and a decoder 20. The data player 100 receives, via the interface section 10, various data including audio data such as MP3 from a memory or the like, and plays the received data.
An audio data stream is transmitted as data frames which are encoded and compressed at a predetermined bit rate. A synchronous signal composed of a bit string having a predetermined synchronous pattern is added to each frame. A frame 30 forming a data stream in an MP3 format, for example, includes a 12-bit synchronous signal 32, a 20-bit header frame 34 following the synchronous signal 32, and a sub frame 36 following the header frame 34, as shown in FIG. 5. In the case of MP3, the synchronous pattern of the synchronous signal 32 is set to “Oxfff”.
The header frame 34 includes information representing the frame properties such as a bit rate indicating the frame length, a frame type, a sampling frequency, emphasis information and so on.
More specifically, an audio data stream is transmitted as a bit string in which a synchronous pattern is inserted for each predetermined frame length, as shown in FIG. 6. Further, a bit string immediately after the synchronous signal indicates a frame length, i.e. a data length between adjacent synchronous patterns.
The audio data is sequentially input to the synchronous pattern detection section 12 via the interface section 10. The synchronous pattern detection section 12 supplies the data stream which is input to the decoder 20, and also detects, as a synchronous pattern, a bit string having a pattern which is equal to a reference synchronous pattern previously registered in a built-in register or the like. Then, the synchronous pattern detection section 12 detects a frame length stored immediately after the synchronous pattern and stores information concerning the detected frame length in the register 14.
After detection of a synchronous pattern, the counter 16 counts the number of bits of data until detection of the next synchronous pattern. Then, when detecting the next synchronous pattern, the synchronous pattern detection section 12 supplies a determination control signal to the synchronization determination section 18. The synchronization determination section 18, receiving the determination control signal, compares a counter value of the counter 16 at that time with the frame length stored in the register 14. If the two values appropriately coincide with each other, the synchronization determination section 18, determining that a correct synchronization timing has been detected, outputs a synchronization setting signal to the decoder 20. The decoder 20, upon receiving the synchronization setting signal, decodes the data stream input from the synchronous pattern detection section 12 for each frame length stored in the register 14, in synchronization with the synchronous timing.
In another conventional data player and a control method thereof, a data stream which is compression-encoded at a variable bit rate including a variable length is played while minimizing the noise made by a fake synchronous signal.
In this technology, a stream type counter which counts stream type information output from a header information analyzer and a stream type judgment section which instructs the start of stream conversion to a signal processing section on the basis of the value of the stream type counter are mounted in a synchronous signal detection section. When the counter value of the stream type counter reaches a predetermined value, it is judged that an input signal is a stream signal. When the value of the stream type counter does not reach the predetermined value, detection of a synchronous signal is restarted from an address which is advanced by one bit from the address stored in a synchronous address storage section.
Here, a data stream includes a plurality of consecutive frames. When a sub frame or the like includes data having the same bit pattern as the synchronous pattern (which is set to “Oxfff” in the above example), there is a possibility that the synchronous pattern detection section 12 will erroneously detect that bit pattern as a synchronous pattern. If the synchronous pattern detection section 12 detects the next synchronous pattern under such a circumstance, the frame length stored in the register 14 and the counter value of the counter 16 do not coincide with each other. This may result in a disadvantage that a long time is required to detect a correct synchronous pattern, retarding start of decoding processing of the data stream to be performed by the decoder 20.